package cn.touna.jss.common.utils;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

/**
 * Created by Steve.Tao on 2018/2/7.
 */
public class ModelUtil {
    public static <T> T toJavaObject(String jsonStr, Class<T> clazz) {
        return JSON.toJavaObject(JSONObject.parseObject(jsonStr), clazz);
    }

    public static <T> T toJavaObject(JSONObject obj, Class<T> clazz) {
        return JSON.toJavaObject(obj, clazz);
    }

}
